//引入redux  创建reducer
// import { configureStore } from "redux";
import { applyMiddleware, combineReducers, createStore, compose } from "redux";
import reduxThunk from 'redux-thunk'//中间件
const reducer = (prevState = {
    count: 10
}, actions) => {
    console.log(actions)
    //可以通过action数据进行判断
    return prevState
}
//也可以将redux 状态拆分为几个部分管理 但是reducer要自己引入合并  
// const reducer = combineReducers({...})
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; //管理redux查看插件
const store = createStore(reducer, composeEnhancers(applyMiddleware(reduxThunk)))//reduxPromise

export default store

//通知  store.dispatch({ type:'action'})
//订阅 store.subscribe(()=>{ 事件})